<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/jquery-3.4.1.js"></script>
</head>
<body>
<input type="checkbox" name="s1" id="s1" checked="checked" />
<button id="disabledBtn">设置禁用</button>
<button id="enabledBtn">设置使能</button>
<button id="getValueBtn">获取值</button>
<button id="setCheckedValueBtn">设置选中</button>
<button id="setNoCheckedValueBtn">设置不选中</button>
<script type="text/javascript">

    $(function () {
        $("#disabledBtn").click(function () {
            $('#s1').attr("disabled", true);
        });
        $("#enabledBtn").click(function () {
            $('#s1').attr("disabled", false);
        });
        $("#getValueBtn").click(function () {
            alert($('#s1').prop("checked"));
        });
        $("#setCheckedValueBtn").click(function () {
            $('#s1').prop("checked", true);
        });
        $("#setNoCheckedValueBtn").click(function () {
            $('#s1').prop("checked", false);
        });
    })

</script>
</body>
</html>